<template>
  <div>
    <div class="detailbox">
      <div class="headbox">
        <div class="smallbox">
          <div class="left">
            <img :src="starInfo.avatar" alt="" />
          </div>
          <div class="right">
            <div class="topright">
              <p class="p1" style="width: 300px;text-align: left;">{{ starInfo.nickname }}</p>
              <p class="p2">加入社区<span style="font-size: 20px;font-weight: bold;">{{ starInfo.create_day }}天</span> </p>
              <div class="toprr">
                <div class="smallimg">
                  <img src="../../assets/img/4.png" alt="" />
                </div>
                <div class="smallimg">
                  <img src="../../assets/img/16.png" alt="" />
                </div>
                <div class="smallimg" style="
                    border-right: none;
                    font-weight: bold;
                    margin-top: 14px;
                  ">
                  复制
                </div>
              </div>
            </div>
            <p style="
                margin-top: 20px;
                text-align: left;
                font-size: 14px;
                line-height: 20px;
                font-weight: 100;
              ">
              资深外汇交易员，EA+人工风控，风险厌恶性选手最优选择！DLS1343账户策略与EC5198账户完全同步！建议5000美金一倍跟随！月均收益5-15%！
            </p>
          </div>
        </div>
      </div>
      <div style="background-color: #f4f7fe">
        <div class="maxbox">
          <div class="left content" :isFixed="isFixed" ref="content">
            <div>
              <h5>交易账户</h5>
              <div class="client" @click="showDetail(item.id)" v-for="(item, index) in starList" :key="item.id">
                <div class="name">
                  <p class="p1">{{ item.account }}</p>
                  <p class="p2">喊单者</p>
                </div>
                <div class="earn">
                  <p class="p1">收益率{{ item.earn_profit }}%</p>
                  <p class="p2">胜率{{ item.winning }}%</p>
                </div>
                <div class="tips">
                  <p class="p1">最大回撤{{ item.withdrawal }}%</p>
                  <p class="p2">净值${{ item.net_value }}</p>
                </div>
              </div>
              <!--  <div class="client">
                <div class="name">
                  <p class="p1">#****5198</p>
                  <p class="p2">喊单者</p>
                </div>
                <div class="earn">
                  <p class="p1">收益率207.16%</p>
                  <p class="p2">胜率71.21%</p>
                </div>
                <div class="tips">
                  <p class="p1">最大回撤1.91%</p>
                  <p class="p2">净值$61426.11</p>
                </div>
              </div> -->
              <div class="statement">
                <h5>重要免责声明</h5>
                <p style="
                    font-size: 13px;
                    color: gray;
                    line-height: 20px;
                    text-align: left;
                  ">
                  外汇市场的保证金交易（含外汇交易、差价合约等）存在较高风险，不适合所有投资者。
                  您需为完全民事行为能力人，
                  能有效签署并遵守条款和所确认的合同。
                  本网站的网页内容（含数据部分）是
                  本站通过在不同经纪商获取的交易结果整理公布，
                  所有信息仅供您参考，并无任何责任，
                  未经本站许可不得使用或以任何形式出售。
                </p>
              </div>
            </div>
          </div>
          <div>
            <div class="right">
              <div class="topname">
                <i class="el-icon-user" style="margin-left: 10px"></i>
                <p>
                  喊单者 {{ select.nickname }} {{ select.account }}
                </p>
<!--                 <p style="
                    font-size: 13px;
                    background-color: rgba(114, 116, 116, 0.1);
                    border-radius: 5px;
                    width: 100px;
                    height: 25px;
                    padding-left: 5px;
                    padding-right: 5px;
                    padding-top: 5px;
                  ">
                  EC Markets
                </p> -->
              <!--   <p style="
                    margin-left: 300px;
                    font-size: 25px;
                    font-weight: 600;
                    color: #0487f9;
                  ">
                  5000
                </p>
                <p style="width: 80px">USD/30天</p> -->
<!--                 <button style="
                    background-color: #0487f9;
                    color: white;
                    font-size: 13px;
                    width: 50px;
                    border-radius: 10px;
                    padding: 3px;
                  ">
                  + 订阅
                </button> -->
              </div>
              <div class="rank">
                <div class="box1">
                  <div class="leftbox">
                    <div style="display: flex">
                      <i class="el-icon-trophy" style="margin-left: 10px"></i>
                      <p style="
                          text-align: left;
                          font-weight: 600;
                          margin-left: 5px;
                        ">
                        账户收益排名
                      </p>
                    </div>
                    <div class="databox">
                      <div class="outbox">
                        <div class="data" style="
                            background-color: #deba9e;
                            border-radius: 50%;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                          ">
                          <p style="
                              font-size: 45px;
                              color: white;
                              font-weight: 600;
                            ">
                            {{ select.rank }}
                          </p>
                          <!-- <p style="font-size: 45px;color: white;font-weight: 600;">/10</p> -->
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="rightbox">
                    <div style="display: flex">
                      <i class="el-icon-tickets" style="line-height: 20px"></i>
                      <p style="
                          text-align: left;
                          font-size: 18px;
                          font-weight: 600;
                          margin-left: 5px;
                        ">
                        交易策略
                      </p>
                    </div>
                    <p style="
                        font-size: 13px;
                        color: gray;
                        line-height: 25px;
                        text-align: left;
                        margin-bottom: 20px;
                      ">
                      资深外汇交易员，EA+人工风控，风险厌恶性选手最优选择！DLS1343账户策略与EC5198
                      账户完全同步！建议5000美金一倍跟随！月均收益5-15%！</p>
                    <p style="text-align: left;margin-bottom: 5px;">{{ select.competence_1 }}分 <span
                        style="color: gray;font-size: 14px;">盈利能力</span></p>
                    <el-progress :percentage="select.competence_1_bl" :show-text="false"></el-progress>
                    <p style="text-align: left;margin-top: 10px;margin-bottom: 10px;">{{ select.competence_2 }}分 <span
                        style="color: gray;font-size: 14px;">风控能力</span></p>
                    <el-progress :percentage="select.competence_2_bl" :show-text="false"></el-progress>
                    <p style="text-align: left;margin-top: 10px;margin-bottom: 10px;">{{ select.competence_3 }}分 <span
                        style="color: gray;font-size: 14px;">稳健性</span></p>
                    <el-progress :percentage="select.competence_3_bl" status="success" :show-text="false"></el-progress>
                    <p style="text-align: left;margin-top: 10px;margin-bottom: 10px;">{{ select.competence_4 }}分 <span
                        style="color: gray;font-size: 14px;">非侥幸获利</span></p>
                    <el-progress :percentage="select.competence_4_bl" status="warning" :show-text="false"></el-progress>
                    <p style="text-align: left;margin-top: 10px;margin-bottom: 10px;">{{ select.competence_5 }}分 <span
                        style="color: gray;font-size: 14px;">资金规模</span></p>
                    <el-progress :percentage="select.competence_5_bl" status="exception" :show-text="false"></el-progress>

                  </div>
                </div>
                <div class="box2" style="display: flex; justify-content: left; margin-top: 20px">
                  <div class="navbox" style="width: 180px">
                    <p style="font-size: 20px; text-align: left; color: #22d1a1">
                      {{ select.winning }}%
                    </p>
                    <p style="font-size: 13px; color: gray; text-align: left">
                      收益率
                    </p>
                  </div>
                  <div class="navbox" style="width: 180px">
                    <p style="font-size: 20px; text-align: left">
                      {{ select.total_amount }}
                      <span style="font-size: 16px">USD</span>
                    </p>
                    <p style="font-size: 13px; color: gray; text-align: left">
                      实盘跟随总额
                    </p>
                  </div>
                  <div class="navbox" style="width: 180px">
                    <p style="font-size: 20px; text-align: left">
                      {{ select.cycle }}
                    </p>
                    <p style="font-size: 13px; color: gray; text-align: left">
                      交易周期
                    </p>
                  </div>
                  <!-- <div class="navbox" style="width: 180px;">
                    <p style="font-size: 20px;text-align: left;">13 <span style="font-size: 16px;">次订阅</span></p>
                    <p style="font-size: 13px;color: gray;text-align: left;">累计订阅</p>
                  </div> -->
                </div>
              </div>
              <detail-data v-if="id" :selectedId="id"></detail-data>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import DetailData from './components/DetailData.vue'
import { starDetailApi, starListApi } from '@/api/index'

export default {
  name: 'detail',
  components: { DetailData },
  data() {
    return {
      //showDetail:false,
      imageURLA:
        'https://fxhot.oss-cn-zhangjiakou.aliyuncs.com/jeecgossbizPath/mmexport1667117043034_1677744831036.png',
      isFixed: false,
      starInfo: {},
      starList: [],
      select: {},
      id: ''
    }
  },

  mounted() {
    const id = this.$route.query.id
    this.id = this.$route.query.id
    console.log(id)
    this.getStarInfo(id)
    this.getList()
    this.showDetail(id)
  },

  methods: {
    getStarInfo(id) {
      console.log(id)
      starDetailApi({ id: id }).then((res) => {
        this.starInfo = res.data.data
        console.log(this.starInfo, '明星详情')
      })
    },

    getList() {
      let data = {
        order: 11,
        sort: 0,
        page: 1,
        page_size: 2
      }
      starListApi(data).then((res) => {
        this.starList = res.data.data.data
        console.log(this.starList)
      })
    },

    showDetail(id) {
      //this.selectedId = id;
      console.log(id)
      starDetailApi({ id: id }).then((res) => {
        this.select = res.data.data
        console.log(this.select, '选中筛选《《《《')
        console.log(res)
      })
    }
  }
}
</script>

<style scoped lang="scss">
.fixed {
  position: fixed;
  top: 100px;
  /* 设置固定位置的top值 */
  /* 其他样式 */
}

.fixed1 {
  margin-left: 300px;
  top: 100px;
  /* 设置固定位置的top值 */
  overflow: auto;
  /* 其他样式 */
}

.headbox {
  width: 100%;
  height: 350px;
  background-color: #cfc0bf;
  box-sizing: border-box;
  padding-top: 100px;
  box-sizing: border-box;

  .smallbox {
    width: 1200px;
    height: 200px;
    //background-color: skyblue;
    padding-left: 20px;
    margin: 0 auto;
    display: flex;
    align-items: center;

    .left {
      width: 150px;
      height: 140px;
      border-radius: 50%;
      background-color: white;

      img {
        width: 140px;
        height: 140px;
        border-radius: 50%;
        padding: 5px;
        box-sizing: border-box;
      }
    }

    .right {
      width: 1000px;
      height: 150px;
      margin-left: 50px;
      padding-left: 20px;
      padding-right: 80px;

      .topright {
        width: 100%;
        height: 80px;
        //background-color: purple;
        display: flex;
        align-items: center;

        .p1 {
          font-size: 30px;
          font-weight: bold;
        }

        .p2 {
          margin-left: 30px;
          width: 70px;
        }

        .toprr {
          width: 250px;
          height: 50px;
          background-color: white;
          margin-left: 290px;
          border-radius: 10px;
          display: flex;
          justify-content: space-around;
          align-items: center;
          padding-top: 5px;
          padding-bottom: 5px;
          box-sizing: border-box;

          .smallimg {
            width: 33%;
            height: 80%;
            border-right: 1px solid rgba($color: gray, $alpha: 0.3);

            img {
              width: 30px;
              height: 30px;
              margin-top: 5px;
            }
          }
        }
      }
    }
  }
}

.maxbox {
  width: 1200px;
  min-height: 2000px;
  padding-top: 20px;
  margin: 0 auto;
  padding-left: 20px;
  box-sizing: border-box;
  background-color: #f4f7fe;
  display: flex;

  .left {
    width: 300px;
    height: 500px;
    background-color: white;

    h5 {
      width: 100%;
      height: 50px;
      text-align: left;
      line-height: 50px;
      padding-left: 20px;
      border-bottom: 1px solid rgba($color: gray, $alpha: 0.3);
    }

    .client {
      width: 100%;
      height: 130px;
      background-color: white;
      padding-top: 20px;
      padding-left: 20px;
      padding-right: 15px;
      box-sizing: border-box;
      border-bottom: 1px solid rgba($color: gray, $alpha: 0.3);

      .name {
        width: 100%;
        height: 30px;
        display: flex;
        justify-content: space-between;

        .p2 {
          height: 20px;
          font-size: 12px;
          color: red;
          padding-left: 3px;
          padding-right: 3px;
          padding-top: 3px;
          padding-bottom: 3px;
          border: 1px solid red;
          border-radius: 5px;
        }
      }

      .earn {
        width: 100%;
        height: 30px;
        margin-top: 10px;
        display: flex;
        justify-content: space-between;
        font-size: 13px;
        color: gray;
      }

      .tips {
        width: 100%;
        height: 30px;
        margin-top: 10px;
        display: flex;
        justify-content: space-between;
        font-size: 13px;
        color: gray;
      }
    }

    .client.active {
      border-left: 2px solid blue;
      background-color: rgba($color: gray, $alpha: 0.2);
    }

    .client:hover {
      background-color: rgba($color: gray, $alpha: 0.2);
    }

    .statement {
      width: 100%;
      height: 320px;
      background-color: white;
      padding-top: 50px;
      padding-left: 20px;
      padding-right: 20px;
      box-sizing: border-box;

      h5 {
        font-weight: 600;
        font-size: 18px;
        text-align: left;
        margin-bottom: 10px;
        border-bottom: none;
      }
    }
  }

  .right {
    width: 900px;
    height: 450px;
    background-color: white;
    margin-left: 20px;

    .topname {
      display: flex;
      align-items: center;
      padding: 10px;
      border-bottom: 1px solid rgba($color: gray, $alpha: 0.3);
    }

    .rank {
      width: 900px;
      height: 500px;
      background-color: white;
      padding-top: 50px;
      padding-left: 30px;
      padding-right: 30px;
      box-sizing: border-box;
      // background-color: aqua;

      .box1 {
        width: 750px;
        height: 370px;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid rgba($color: gray, $alpha: 0.2);
        //background-color: pink;

        .leftbox {
          width: 300px;
          height: 350px;

          .databox {
            width: 210px;
            height: 210px;
            border-radius: 50%;
            border: 1px solid #deba9e;
            margin-top: 50px;
            margin-left: 60px;
            padding: 10px;

            .outbox {
              width: 100%;
              height: 100%;
              border-radius: 50%;
              border: 2px solid #deba9e;
              padding: 10px;
            }

            .data {
              // margin-top: 10px;
              // margin-left: 10px;
              width: 100%;
              height: 100%;
              border-radius: 50%;
              //border: 2px solid #deba9e;
            }
          }
        }

        .rightbox {
          width: 450px;
          height: 350px;

          //background-color: skyblue;
          .box2 {
            padding-top: 20px;
          }
        }
      }
    }
  }
}

::v-deep .el-progress-bar__inner {
  height: 5px;
  /* 修改线条高度为 6px */
}
</style>
